package com.jindun.paper.ui.handler;

import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;

import com.jindun.paper.model.Order.OrderType;
import com.jindun.paper.ui.bag.OrderEditorInput;

public class BoxOrderAddHandler extends AbstractHandler {

	@Override
	public Object execute(ExecutionEvent event) throws ExecutionException {
		try {
			PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().openEditor(new OrderEditorInput(-1, OrderType.BOX.getCode()), "boxOrderEditor");
		} catch (PartInitException e) {
		
			e.printStackTrace();
		}
		return null;
	}

}
